//引入请求方法 baseUrl /api

import request from ".";

//添加管理员
export const requestLoginAdmin = (userInfo) => {
  return request({
    url: "/addAdmin",
    method: "post",
    data: userInfo,
  });
};

//请求管理员列表
export const requestAdminList = () => {
  return request({
    url: "/adminList",
    method: "get",
  });
};

//删除管理员 /deleteAdmin
export const requestDeletAdmin = (adminName) => {
  return request({
    url: `/deleteAdmin`,
    method: "delete",
    params: {
      adminName,
    },
  });
};

//登陆请求
export const requestLogin = (userInfo) => {
  return request({
    url: "/login",
    method: "post",
    data: userInfo,
  });
};

//上传图片接口
export const requestUpLoadImg = (imgInfo) => {
  return request({
    url: "/addAdv",
    method: "put",
    data: imgInfo,
    // headers: {
    //   transformRequest: [(data) => data],
    // },
  });
};

//请求所有图片数据
export const requestImg = () => {
  return request({
    url: "/getImg",
    method: "get",
  });
};
